Main Tab 1

Column

Column Tab 1

# A tibble: 16,598 × 11
    Rank Name          Platform Year  Genre Publisher NA_Sales EU_Sales JP_Sales
   <dbl> <chr>         <chr>    <chr> <chr> <chr>        <dbl>    <dbl>    <dbl>
 1     1 Wii Sports    Wii      2006  Spor… Nintendo      41.5    29.0      3.77
 2     2 Super Mario … NES      1985  Plat… Nintendo      29.1     3.58     6.81
 3     3 Mario Kart W… Wii      2008  Raci… Nintendo      15.8    12.9      3.79
 4     4 Wii Sports R… Wii      2009  Spor… Nintendo      15.8    11.0      3.28
 5     5 Pokemon Red/… GB       1996  Role… Nintendo      11.3     8.89    10.2 
 6     6 Tetris        GB       1989  Puzz… Nintendo      23.2     2.26     4.22
 7     7 New Super Ma… DS       2006  Plat… Nintendo      11.4     9.23     6.5 
 8     8 Wii Play      Wii      2006  Misc  Nintendo      14.0     9.2      2.93
 9     9 New Super Ma… Wii      2009  Plat… Nintendo      14.6     7.06     4.7 
10    10 Duck Hunt     NES      1984  Shoo… Nintendo      26.9     0.63     0.28
# ℹ 16,588 more rows
# ℹ 2 more variables: Other_Sales <dbl>, Global_Sales <dbl>

Column Tab 2

Column Tab 3

Column

Row 1

# A tibble: 16,598 × 11
    Rank Name          Platform Year  Genre Publisher NA_Sales EU_Sales JP_Sales
   <dbl> <chr>         <chr>    <chr> <chr> <chr>        <dbl>    <dbl>    <dbl>
 1     1 Wii Sports    Wii      2006  Spor… Nintendo      41.5    29.0      3.77
 2     2 Super Mario … NES      1985  Plat… Nintendo      29.1     3.58     6.81
 3     3 Mario Kart W… Wii      2008  Raci… Nintendo      15.8    12.9      3.79
 4     4 Wii Sports R… Wii      2009  Spor… Nintendo      15.8    11.0      3.28
 5     5 Pokemon Red/… GB       1996  Role… Nintendo      11.3     8.89    10.2 
 6     6 Tetris        GB       1989  Puzz… Nintendo      23.2     2.26     4.22
 7     7 New Super Ma… DS       2006  Plat… Nintendo      11.4     9.23     6.5 
 8     8 Wii Play      Wii      2006  Misc  Nintendo      14.0     9.2      2.93
 9     9 New Super Ma… Wii      2009  Plat… Nintendo      14.6     7.06     4.7 
10    10 Duck Hunt     NES      1984  Shoo… Nintendo      26.9     0.63     0.28
# ℹ 16,588 more rows
# ℹ 2 more variables: Other_Sales <dbl>, Global_Sales <dbl>

Row 2

Main Tab 2

Column {data-width=500}

3. Example

library(plotly)
df <- data.frame(x=c(1, 2, 3, 4), y=c(1, 5, 3, 5), group=c('A', 'A', 'B', 'B'))
p <- ggplot(data=df, aes(x=x, y=y, colour=group)) + geom_point()
ggplotly(p)

Column

Row 1

Row 2

M

---
title: "Untitled"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
    source_code: embed
    social: menu
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
#install.packages("plotly")
library(plotly)
library(knitr)
library(DT)
library(flexdashboard)
library(tidyverse)
library(knitr)
df <- read_csv('vgsales.csv')
head(df)
# Create a ggplot object
df1 = df %>% 
  ggplot()+
  geom_point(aes(x=NA_Sales, y=EU_Sales))+labs(title="Length of Stay by Age, and by Sex", caption="For males, there are more stays over 500 days for people under 40 years old. But there are no major differences between genders")
df1
df2 = df %>% 
  filter(Platform=='PS4'|Platform=='XOne') %>% 
  ggplot()+
  geom_point(aes(x=NA_Sales, y=EU_Sales))+facet_wrap(~Platform)+labs(title="Length of Stay by Age, and by Sex", caption="For males, there are more stays over 500 days for people under 40 years old. But there are no major differences between genders")
df2

```
{.sidebar}
=======================================================================

Main Tab 1
=======================================================================

Column {data-width=500, .tabset}
-----------------------------------------------------------------------

### Column Tab 1

```{r}
df
```


### Column Tab 2

```{r}

#kable(df)

```


### Column Tab 3

```{r}
datatable(df, options = list(
  pageLength = 25
))
```
Column {data-width=500}
-----------------------------------------------------------------------

### Row 1

```{r}
df
```

### Row 2

```{r}
ggplotly(df1)

```


Main Tab 2
=======================================================================

Column {data-width=500}

#### 3. Example

```{r, echo=TRUE, eval=TRUE}
library(plotly)
df <- data.frame(x=c(1, 2, 3, 4), y=c(1, 5, 3, 5), group=c('A', 'A', 'B', 'B'))
p <- ggplot(data=df, aes(x=x, y=y, colour=group)) + geom_point()
ggplotly(p)
```



Column {data-width=500}
-----------------------------------------------------------------------

### Row 1

```{r}
df2
```

### Row 2

```{r}

ggplotly(df2)

```

M